﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharp4Essential
{
    class Program
    {
        private static void testParallel()
        {
            int x = 0;
            Parallel.For(0, 1000000, i => {
                x++;
                x--;
            });

            Console.WriteLine(x);
        }

        static void Main(string[] args)
        {
            testParallel();
            Console.Read();
        }
    }
}
